const TOKEN_KEY = 'token';

const isLogin = () => {
  return !!uni.getStorageSync(TOKEN_KEY);
};

const getToken = () => {
  return uni.getStorageSync(TOKEN_KEY);
};

const setToken = (token: string) => {
  uni.setStorageSync(TOKEN_KEY, token);
};

const clearToken = () => {
  uni.removeStorageSync(TOKEN_KEY);
};

export { isLogin, getToken, setToken, clearToken };
